<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/base/utils.html">
<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/extras/importer/trace_event_importer.html">
<link rel="import" href="/tracing/model/event_set.html">
<link rel="import" href="/tracing/model/model.html">
<link rel="import" href="/tracing/ui/extras/chrome/cc/raster_task_selection.html">

<script src="/tracing/extras/chrome/cc/layer_tree_host_impl_test_data.js">
</script>

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('basic', function() {
    const m = tr.c.TestUtils.newModelWithEvents([g_catLTHIEvents]);
    const p = m.processes[1];
    const rasterTasks = p.threads[1].sliceGroup.slices.filter(function(slice) {
      return slice.title === 'RasterTask';
    });

    let selection = new tr.model.EventSet();
    selection.push(rasterTasks[0]);
    selection.push(rasterTasks[1]);

    assert.isTrue(tr.ui.e.chrome.cc.RasterTaskSelection.supports(selection));
    selection = new tr.ui.e.chrome.cc.RasterTaskSelection(selection);
    const highlights = selection.extraHighlightsByLayerId;
    assert.lengthOf(Object.keys(highlights), 1);
  });
});
</script>
